<!--{template admin/header}-->

<div id="main_wp" class="mt10">
    <form action="admin.php?" method="get">
        <input type="hidden" value="member" name="mod">
        <input type="hidden" value="dosearch" name="code">
        <table cellspacing="1" width="100%" align="center" class="tableborder">
            <tr class="header">
                <td colspan="6">快捷搜索
                    <span style="float:right;"><a href="#" onclick="collapse_change('tip')">收缩/展开</a></span></td>

            </tr>
            <tbody id="menu_tip" style="display:">
                <tr>
                    <td class="altbg1" width="120" >用户昵称</td>
                    <td class="altbg2">
                        <input type="text" name="nickname" value="{$nickname}" size="20" onkeyup="ajax_nickname(this, this.value);" autocomplete="off"></input>
                    </td>
                    <td class="altbg1" width="120" >用户ID</td>
                    <td class="altbg2">
                        <input type="text" name="uid" value="{$uid}" size="20"></input>
                    </td>
                </tr>
                <tr>
                    <td class="altbg1" width="120">角色</td>
                    <td class="altbg2">
                        <select name="select_role_id">
                            <option value="">请选择</option>
                            <!--{loop $role_list $key $val}-->
                            <option value="{$key}">{$val[name]}</option>
                            <!--{/loop}-->
                        </select>
                    </td>
                    <td class="altbg1" width="120" ></td>
                    <td class="altbg2">
                    </td>
                </tr>
                <tr>
                    <td class="altbg1" width="120"></td>
                    <td class="altbg2">
                        <button class="button lf" type="submit" name="setting_submit" id="setting_submit" title="CTRL+ENTER提交" style="margin-right: 10px;">搜索</button>&nbsp;&nbsp;
                        <button class="button lf" type="button" onclick="window.location.href = 'admin.php?mod=member&code=$this->Code';
                                return false;">全部用户</button>
                    </td>
                    <td class="altbg1" width="120" ></td>
                    <td class="altbg2">
                    </td>
                </tr>
        </table>
    </form>
</div>
<form method="post" action="{$action}">
    <table cellspacing="1" cellpadding="4" width="100%" align="center" class="tableborder">
        <tr align="center" class="header">

            <td width="5%"><label><input type="checkbox" name="chkall" onclick="checkall(this.form, 'ids')" class="checkbox">选</label></td>
            <td width="12%">昵称/角色</td>
            <td width="20%">Email&nbsp;/&nbsp;注册IP:端口<br>上次访问IP:端口</td>
            <td width="12%">积分情况</td>
            <td width="12%">注册时间/推荐人</td>
            <td>所在{$d_c_name}</td>
            <td>所属{$d_d_name}</td>
            <td>任职{$d_j_name}</td>
            <td >操作</td>

        </tr>

        <!--{if $order_html}-->
        <tr>
            <td colspan="9" style="text-align:right;">排序：{$order_html}</td>
        </tr>
        <!--{/if}-->

        <!--{loop $member_list $member}-->
        <tr class="altbg2" onmouseover="this.className = 'altbg1'" onmouseout="this.className = 'altbg2'">
            <td style="border-bottom:1px dotted #EDEDED">
                <input type="checkbox" name="ids[]" value="{$member[uid]}" class="checkbox"></td>

            <td style="border-bottom:1px dotted #EDEDED">

                <a href="admin.php?mod=member&code=list&invite_uid={$member[uid]}" title="点此查看我推荐注册的用户">{$member[nickname]}</a>
                <!--{if $member[validate]}--><img src="./images/vip.gif" title="{$member[validate_remark]}"/><!--{/if}-->
                <br><span style="color:gray;">{$member[role_name]}</span>
            </td>
            <td style="border-bottom:1px dotted #EDEDED">
                {$member[email]}			  
                <br>
                <span style="color:gray;">{$member[regip]}:{$member[reg_ip_port]}</span>			  
                <br>
                <span style="color:gray;">{$member[lastip]}:{$member[last_ip_port]}</span>
            </td>

            <td style="border-bottom:1px dotted #EDEDED"><span>总积分:<a href="admin.php?mod=sign&code=credits_detail&uid=$member[uid]" title="查看$member[nickname]的积分详情">{$member[totle_credit]}</a></span>
                <div id="credits_{$member[uid]}">
                    <!--{loop $member[credit] $key $val}-->
                    <span style="color:gray;">$val[name]:$val[credit]</span>;
                    <!--{/loop}-->
                </div>
            </td>			

            <td style="border-bottom:1px dotted #EDEDED">
                <!--{eval echo my_date_format($member[regdate], 'Y-m-d H:i:s')}--> <br>
                <!--{if $member[invite_uid]>0}-->
                <!--{eval $member[invite_nickname]=$invite_members[$member[invite_uid]][nickname];}-->
                <a href="admin.php?mod=member&code=list&invite_uid={$member[invite_uid]}" title="点此查看 {$member[invite_nickname]} 推荐注册的所有注册用户"><span style="color:gray;"><!--{if $member[invite_nickname]}-->{$member[invite_nickname]}<!--{else}-->无<!--{/if}--></span></a>
                <!--{else}-->
                无
                <!--{/if}-->
            </td>

            <td style="border-bottom:1px dotted #EDEDED">
                <!--{if $companyid && $member[companyid] != $companyid}--><b>主属{$d_c_name}</b><br><!--{/if}-->
                {$member[company]}</td>
            <td style="border-bottom:1px dotted #EDEDED">
                <!--{if $departmentid && $member[departmentid] != $departmentid}--><b>主属{$d_d_name}</b><br><!--{/if}-->
                {$member[department]}</td>
            <td style="border-bottom:1px dotted #EDEDED">{$member[job]}</td>
            <td style="border-bottom:1px dotted #EDEDED"> 
                <a href="admin.php?mod=account&code=index&uid={$member[uid]}" title="查看其绑定了哪些平台帐号" target=_blank>[平台帐号绑定]</a> <br>
                <a href="admin.php?mod=member&code=modify&id={$member[uid]}">[编辑]</a> &nbsp; 
                <a href="admin.php?mod=member&code=dodelete&ids={$member[uid]}" onclick="return confirm('你确实要删除吗?不可恢复');">[删除]</a> &nbsp; 
            </td>
        </tr>
        <!--{/loop}-->

        <!--{if $pages['html']}-->
        <tr>
            <td colspan="9">{$pages['html']}</td>
        </tr>
        <!--{/if}-->

        <tr  style="text-align:top;">
            <td colspan="2" class="altbg1">
                选择相应操作： <label onclick="document.getElementById('medal_id').style.display = 'none';
                        document.getElementById('msg').style.display = 'none';"><input type="radio" name="act" id="act" value="deluser" />删除</label>
            </td>
            <td colspan="1" class="altbg1">
                <label onclick="document.getElementById('medal_id').style.display = 'block';
                        document.getElementById('msg').style.display = 'none';"><input type="radio" name="act" id="setmedal" value="setmedal" />发勋章</label>
                <select name="medal_id" id="medal_id" style="display:none">
                    <option value="" selected>-请选择-</option>
                    <!--{loop $medal $key $val}-->
                    <option value="{$key}">{$val}</option>
                    <!--{/loop}-->
                </select>
            </td>
            <td colspan="5" class="altbg1">
                <label onclick="document.getElementById('msg').style.display = 'block';
                        document.getElementById('medal_id').style.display = 'none';"><input type="radio" name="act" id="sendmsg" value="sendmsg" />发私信</label>
                <textarea rows="3" cols="10" id="msg" name="msg" style="width: 285px; height: 45px;display:none">{$msg}</textarea>
            </td>
        </tr>
    </table>
    <script type="text/javascript">
        $(document).ready(function() {
            var sendmsg = document.getElementById('sendmsg').checked;
            var setmedal = document.getElementById('setmedal').checked;
            if (sendmsg) {
                document.getElementById('msg').style.display = 'block';
                document.getElementById('medal_id').style.display = 'none';
            } else if (setmedal) {
                document.getElementById('medal_id').style.display = 'block';
                document.getElementById('msg').style.display = 'none';
            }
        })
    </script>

    <center><input type="submit" name="editsubmit" value="提 交" class="button"></center>
</form>

